<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@page import="com.lmpop.trade.ti_collect.*" %>
<%@page import="java.util.*" %>
<%@page import="com.lmpop.frame.util.PageTools" %>
<%@page import=" com.lmpop.frame.util.Config" %>
<%
	
	Config configa = new Config();
	String  goods_article_path = configa.getString("goods_article_path");
	String  company_shop_path = configa.getString("company_shop_path");
	String  news_article_path = configa.getString("news_article_path");
	String user_id = "";	
	if( session.getAttribute("session_user_id") != null ){
		user_id = session.getAttribute("session_user_id").toString();
	}
//out.print(user_id);
	request.setCharacterEncoding("UTF-8");
	Map ti_collect = new Hashtable();
	ti_collect.put("user_id",user_id);
	String s_info_type = "0";
	if(request.getParameter("info_type")!=null && !request.getParameter("info_type").equals("")){
		s_info_type = request.getParameter("info_type");
		ti_collect.put("info_type",s_info_type);
	} else {
		ti_collect.put("info_type","0");
	}
	Ti_collectInfo ti_collectInfo = new Ti_collectInfo();
	String iStart = "0";
	int limit = 20;
	if(request.getParameter("iStart")!=null) iStart = request.getParameter("iStart");
	List list = ti_collectInfo.getListByPage(ti_collect,Integer.parseInt(iStart),limit);
	int counter = ti_collectInfo.getCountByObj(ti_collect);
	String pageString = new PageTools().getGoogleToolsBar(counter,"index.jsp?iStart=",Integer.parseInt(iStart),limit);
%>
	<script language="javascript" type="text/javascript" src="commen.js"></script>
	<script src="/js/commen.js" type="text/javascript"></script>
<div class="f-right w750">
    <table width="100%" border="0" cellspacing="0" cellpadding="0" >
      <tr>
        <td><table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#eddfea">
            <tr>
              <td width="5%" height="40" align="center"><img src="/program/member/index/images/icon1.gif" width="22" height="22"></td>
              <td width="75%"><h3>我的收藏</h3></td>
              <td width="20%"> </td>
            </tr>
          </table>
		  
		   	<div class="ts"> <img src="/program/member/index/images/ts.gif" align="absmiddle" /> 选择相应的类型，可以查看您已经收藏的商品，资讯或店铺。 </div>
		  
          <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <DIV class="focus-area-setTab-menu">
			        <UL>
			          <LI class="<%if(s_info_type.equals("0")){%>hover<%}%>"  onclick="setType('0','<%=menu_id%>');" id="tab_0">商品收藏</LI>
			          <LI class="<%if(s_info_type.equals("1")){%>hover<%}%>"  onclick="setType('1','<%=menu_id%>');" id="tab_1">店铺收藏</LI>
					  <LI  class="<%if(s_info_type.equals("2")){%>hover<%}%>"  onclick="setType('2','<%=menu_id%>');" id="tab_2">资讯收藏</LI>
			        </UL>
			        <DIV class="clear"></DIV>
			      </DIV>
          </table>		  
		  
	
	<% 
		int listsize = 0;
		if(list!=null && list.size()>0){
			listsize = list.size();
	%>

          <table width="100%" height="30" border="0" bgcolor="#eddfea"  cellspacing="0" cellpadding="2">
            <tr>
              <td width="18%" align="left">
			  <%if(s_info_type.equals("0")){%>商品名称<%}%>
			  <%if(s_info_type.equals("1")){%>店铺名称<%}%>
			  <%if(s_info_type.equals("2")){%>资讯标题<%}%>
			  </td>
              <td width="24%" align="center">收藏时间</td>
              <td width="12%" align="center">查看详情</td>
			  <td width="10%" align="center">删除收藏</td>
            </tr>
          </table>
          <table width="100%" border="0" cellpadding="0" cellspacing="0"   class="table_list">


		<% 

		  		for(int i=0;i<list.size();i++){
		  			Hashtable map = (Hashtable)list.get(i);
		  			String collect_id="",s_user_id="",info_type="",info_id="",info_cust_id="",title="",in_date="",send_date="";
		  			  	if(map.get("trade_id")!=null) collect_id = map.get("trade_id").toString();
						if(map.get("user_id")!=null) s_user_id = map.get("user_id").toString();
						if(map.get("info_type")!=null) info_type = map.get("info_type").toString();
						if(map.get("info_id")!=null) info_id = map.get("info_id").toString();
						if(map.get("info_cust_id")!=null) info_cust_id = map.get("info_cust_id").toString();
						if(map.get("title")!=null) title = map.get("title").toString();
						if(map.get("in_date")!=null) in_date = map.get("in_date").toString();
						if(in_date.length()>19)in_date=in_date.substring(0,19);
						if(map.get("send_date")!=null) send_date = map.get("send_date").toString();
						if(send_date.length()>10)send_date=send_date.substring(0,10);
						String infoUrl="";
						if(info_type.equals("0")){
							infoUrl = goods_article_path + send_date +"/"+ info_id + ".html";
						}else if(info_type.equals("1")){
							infoUrl = company_shop_path + info_id;
						}else if(info_type.equals("2")){
							infoUrl = news_article_path + send_date +"/"+ info_id + ".html";
						}
		  %>

            <tr>
             
              <td width="18%" height="80" align="left">
				<a href="<%=infoUrl%>" target="_blank"><%=title%></a>
			  </td>
 
              <td width="24%" align="center">
			 <%=in_date%>
			  </td>
              <td width="12%" align="center">
				<a href="<%=infoUrl%>" target="_blank"><img src="/program/images/magnifier.jpg" border="0">
			  </a>
			  </td>

			  <td width="10%" align="center"><a href="javascript:deleteOneInfo('<%=collect_id%>','1671');"><img src="/program/member/index/images/delete.gif" border="0" /></a></td>
            </tr>
		  <%
		  		}
		  %>


          </table>


          
	<%
		 }
	%>
	
		 <table width="100%" border="0" cellpadding="0" cellspacing="0">
            <tr>
              <td width="4%" height="35" align="center">
			  <%=pageString %>
			  </td>
            </tr>
          </table>

		  </td>
      </tr>
    </table>
   
  </div>